package cn.walls1717.ggkt.client.course;

import cn.walls1717.ggkt.model.vod.Course;
import cn.walls1717.ggkt.model.vod.Teacher;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 课程远程调用接口
 *
 * @author walls1717
 * @since 2022/7/20
 */
@Api(tags = "课程远程调用相关接口")
@FeignClient(value = "service-vod")
public interface CourseFeignClient {

    /**
     * 根据关键字查询课程
     *
     * @param keyword 关键字
     * @return 课程集合
     */
    @ApiOperation("根据关键字查询课程")
    @GetMapping("/api/vod/course/inner/findByKeyword/{keyword}")
    List<Course> innerListCoursesByKeyword(@PathVariable String keyword);

    /**
     * 根据课程id查询课程
     *
     * @param courseId 课程id
     * @return 课程信息
     */
    @ApiOperation("根据课程id查询课程")
    @GetMapping("/api/vod/course/inner/getById/{courseId}")
    Course innerGetCourseById(@PathVariable Long courseId);

    /**
     * 根据讲师id查询讲师
     *
     * @param id 讲师id
     * @return 讲师
     */
    @ApiOperation("根据id查询讲师(远程调用接口)")
    @GetMapping("/admin/vod/teacher/inner/getTeacher/{id}")
    Teacher innerGetTeacherById(@PathVariable Long id);
}